import {getjgList,getzzList,getcyList,getzzContent,hyaddDept,getMyaddTeam} from '@/api/zzjg/zzjg.js'
export default {
  namespaced: true,
  state: () => ({
	jgData:[]
	
  }),

  mutations: {
    SET_JG(state,jgData){
		state.jgData=jgData
	}
  },

  // 模块的 mutations 方法
  actions: {
	  //获取机构列表
	getjgListAction({commit},payload){
		getjgList(payload.data).then(res=>{
			commit('SET_JG',res.data.data)
			if(payload.success){
				payload.success(res.data.data)
			}
		})
	},
	//获取组织列表
	getzzListAction({commit},payload){
		getzzList(payload.data).then(res=>{
			if(payload.success){
				payload.success(res)
			}
		})
	},
	//获取组织详情
	getzzContentAction({commit},payload){
		getzzContent(payload.deptId).then(res=>{
			if(payload.success){
				payload.success(res)
			}
		})
	},
	
	//获取组织成员列表
	getcyListAction({commit},payload){
		getcyList(payload.data).then(res=>{
			if(payload.success){
				payload.success(res)
			}
		})
	},
	
	
	//会员加入组织
	hyaddDeptAction({commit},payload){
		hyaddDept(payload.deptId).then(res=>{
			if(payload.success){
				payload.success(res)
			}
		})
	},
	//我的组织
		getMyaddTeamAction({commit},payload){
			getMyaddTeam ().then(res=>{
				if(payload.success){
					payload.success(res)
				}
			})
		},
		
  },

  // 模块的 getters 属性
  getters: {
	
  }
}